package org.raymond.iworks.study.basic.designpattern.factory.simple.pizzastore.order;

import org.raymond.iworks.study.basic.designpattern.factory.simple.pizzastore.pizza.PepperPizza;
import org.raymond.iworks.study.basic.designpattern.factory.simple.pizzastore.pizza.Pizza;
import org.raymond.iworks.study.basic.designpattern.factory.simple.pizzastore.pizza.CheesePizza;
import org.raymond.iworks.study.basic.designpattern.factory.simple.pizzastore.pizza.GreekPizza;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
public class SimpleFactory {
    public Pizza createPizza(String orderType){
        Pizza pizza = null;
        System.out.println("使用简单工厂模式");
        if("greek".equals(orderType)){
            pizza = new GreekPizza();
        }else if("cheese".equals(orderType)){
            pizza = new CheesePizza();
        }else if("pepper".equals(orderType)){
            pizza = new PepperPizza();
        }
        return pizza;
    }
}
